package com.xiaoshuidi.cloud.module.contract.enums.contract;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @Description:
 * @author: zhaoyu
 * @date: 2023/6/28
 */
@Getter
@AllArgsConstructor
public enum CompanyContractTypeEnum {
    //类型 0审批中 1已生效 2续租 3已驳回 4退租 5已到期
    APPROVING(0, "审批中"),
    EFFECTIVE(1, "已生效"),
    RENEWAL(2, "续租"),
    REJECTED(3, "已驳回"),
    RENTING_OUT(4, "退租"),
    EXPIRED(5, "已到期");
    //编码
    private final Integer code;
    //信息
    private final String msg;

    public static CompanyContractTypeEnum getByCode(Integer code) {
        for(CompanyContractTypeEnum e : CompanyContractTypeEnum.values()){
            if(e.code.equals(code)){
                return e;
            }
        }
        return null;
    }
}
